package com.redis.data.seckillshopping.entity;

import com.redis.data.seckillshopping.utils.JsonUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @author 哲思小辉
 * @version 1.0.0
 * @ClassName BaseEntity.java
 * @Description 实体超类
 * @Param
 * @createTime 2020年03月27日 10:49:00
 */
@Setter
@Getter
public class BaseEntity {

    /**
     * 主键
     */
    @ApiModelProperty(name = "id", value = "主键", dataType = "Long", example = "11111")
    private Integer id;

    /**
     * 创建时间
     */
    @ApiModelProperty(name = "createTime", value = "创建时间", example = "2020-01-01 08:08:000")
    private Date createTime = new Date();
    /**
     * 更新时间
     */
    @ApiModelProperty(name = "updateTime", value = "更新时间", example = "2020-01-01 08:08:000")
    private Date updateTime = new Date();

    @Override
    public String toString() {
        return JsonUtil.toJson(this);
    }
}
